<template>
  <el-form-item :label="i18nt('designer.setting.circle')">
    <el-switch v-model="optionModel.circle"></el-switch>
  </el-form-item>
  <el-form-item label="提交按钮">
    <el-switch v-model="optionModel.isSubmit"></el-switch>
  </el-form-item>
  <el-form-item v-if="!!optionModel.isSubmit" :label="'提交服务名称'">
    <el-select v-model="optionModel.postKey" filterable clearable multiple>
      <el-option v-for="(item) in services" :key="item.id"
                 :label="item.service.name" :value="item.id"></el-option>
    </el-select>
  </el-form-item>
</template>

<script>
import i18n from '@/utils/i18n'

export default {
  name: 'circle-editor',
  mixins: [i18n],
  props: {
    designer: Object,
    selectedWidget: Object,
    optionModel: Object,
  },
  computed: {
    services() {
      if (!this.designer.formConfig || !this.designer.formConfig.serviceVersionVOs) {
        return []
      } else {
        return this.designer.formConfig.serviceVersionVOs
      }
    },
  },
}
</script>

<style scoped>

</style>
